﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Light.Framework
{
    /// <summary>
    /// 数据库n:n 字段映射特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class ManyToManyAttribute : Attribute
    {
        /// <summary>
        /// 构造函数：列名和属性名一致的时候用
        /// </summary>
        public ManyToManyAttribute()
        {

        }

        /// <summary>
        /// 关联的表实体类型
        /// </summary>
        public Type Type { get; set; }

        /// <summary>
        /// 多对多关系表表名
        /// </summary>
        public string Table { get; set; }

        /// <summary>
        /// 关联的表字段名
        /// </summary>
        public string ColumnRef { get; set; }

        /// <summary>
        /// 当前实体表字段名
        /// </summary>
        public string ColumnKey { get; set; }

    }
}
